All Questions
56 questions
1vote
1answer
48views
Search and replace content
PIN A 1 1:3 0:8 0 0:0 PIN B 1 1:0 0 0:0 Z Z:0 PIN C 1 1:3 0:8 0 0:0 Z Z:0 I would like to change the content on PIN A & PIN C only without affecting PIN B to 0 0:3 Z 0:3 Can't seem to find a ...
0votes
1answer
114views
How do I find and replace something AFTER a specific term in a terminal output
I need to run blkid and copy a specific UUID after a specific known partition name. Then, I need to paste this into an exists config file, replacing a UUID that it's already there (parent_device_uuid)....
0votes
1answer
916views
ansible lineinfile module to match variable_value
how can one possibly match value of a variable through regex parameter in lineinfile module? - name: emptyline before search lineinfile: dest: ~/file insertbefore: '^{{ search_text }}$' ...
0votes
1answer
110views
uncomment the line upon search string while ignoring case in a file
Below is my cron file entries: #Ansible: test2 */15 * * * * ansible-playbook /web/playbooks/automation/detect401MORTEN/va_action.yml | tee -a /web/playbooks/automation/detect401MORTEN/cron.out # #...
1vote
2answers
850views
awk get column value from file 2 for file 1 if value matches in 2 columns [duplicate]
I have 2 files, trying to set column value that is taken from file2 into file1 when their columns match file1: signup||20200620|A3332|en|LA||ACTIVE signup||20200620|B4443|en|CA|66001|ACTIVE signup||...
-1votes
2answers
178views
awk bring same field value from file1 and set in file2 [closed]
File1 (parent) 2210 1110 Earth 2211 1111 Marse 2212 1112 Saturn 2213 1113 Pluto File2 (child) 3310 2210 Earth 3311 2210 Space 3312 2211 Mars 3313 2211 Space 3314 2212 Saturn 3315 2212 Space 3316 ...
-1votes
3answers
499views
awk print only modified lines
I have file like this d1000 1000 d1001 100 d1002 10 d1003 1 I want to modify second column where length is not equal 4. But I want to print only lines that are modified, so original text in column 2 ...
-1votes
1answer
54views
Search & replace for a string separated by whitespace upon substring match found
Below is a sample file content: cat sample.txt -server -XX:+UseParallelGC -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+AggressiveHeap -XX:+PrintHeapAtGC -Djava.util.logging.FileHandler....
0votes
4answers
380views
Search and Remove Lines of Code from all files
I need help and need to search for and remove a 3 line bit of code from all files in a directory. Code is: if ( file_exists( plugin_dir_path( __FILE__ ) . '/.' . basename( plugin_dir_path( __FILE__ ) )...
2votes
3answers
1kviews
Replace dynamic word using sed command
I have a requirement where we need to replace a word in a file which can be different everytime I execute the script, the content of the file is class DynamicContentToReplace > Something Here I ...
2votes
1answer
538views
How to add closing XML tags with sed
I have the following example in the XML doc: <meta name=Originator content="text/html; charset=iso-8859-6"> <meta name=ProgId content=Word.Document> <meta name=Generator ...
-1votes
4answers
534views
How to replace a part of the word using sed command
I have a file with just one word in each line. I want to delete some part of the word in each line. How can I delete that part using sed command? Ex: u_fox/u_snake/u_snail/u_plus/u_core/u_vector/...
0votes
1answer
476views
VIM Search and Replace to Correct Broken Line Breaks
I have a file that I am busy trying to correct that has some dodgy Line Breaks inside of it, this is a small example Row ('Row 01') Property ('Property 01') Row ('Row 02') Property ('Property 02') Row ...
1vote
2answers
470views
Complicated search and replace in Vim or Sed
I have the following (yanked from my register to retain formatting, as it's probably the reason I'm here): <li><span>Concrete Patching (</span><span style="overflow: ...
0votes
1answer
106views
replace string from left to right in a line
I want to search and replace the negative values with the value just before it. The values are separated by comma. Example: ocv_sigma_cell_rise(table_7) { sigma_type : early_and_late; values(&...